<?php
namespace Home\Controller;
use Think\Controller;
class RegisterController extends Controller{
    public function checkregister(){
        $data['telephone'] = $_POST['telephonesign'];
        $data['password'] = md5($_POST['passwordsign']);
        $m = M("user");
        $m->create($data);
        $result = $m->add();
        if($result == true){
            session("username", $data['telephone']);
            $this->success("注册成功", __APP__."/Home/Index/index");
        }else{
            $this->error("注册失败，用户名已经被占用");
        }
        
    }
}